#FROM findepi/graalvm:java17-native
FROM registry.cn-shanghai.aliyuncs.com/qypx/liberica-openjdk-debian:21.0.7

MAINTAINER Lion Li

RUN mkdir -p /zhixin/snailjob/logs

WORKDIR /zhixin/snailjob

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms256m -Xmx512m"

ENV TZ=Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

EXPOSE 8800
EXPOSE 1788

ADD target/zhixin-snailjob-server.jar ./app.jar

ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
           -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
           -jar -Dloader.path=./lib app.jar
